/**
 充值记录
 */

layui.define(['form', 'admin', 'layer'], function (exports) {
    var $ = layui.$, admin = layui.admin, form=layui.form, layer = layui.layer;
    form.on("submit(edit-btn)", function (data) {
        var data = data.field;
        if(data.number == ""){
            return layer.msg('请输入合法有效变动金额');
        }
        admin.req({
            url: '/admin/users/recharge/'
            , type: 'post'
            , data: data
            , success: function (res) {
                layer.closeAll('dialog');
                if (res.code == 0) {
                    layer.msg(res.msg, {icon: 1, time: 1000}, function () {
                        parent.location.reload()
                    });
                }
            }
        });
    })

    //对外暴露的接口
    exports('recharge', {});
});